fix: improving feature util test coverage #104
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available: n/a
Notes
This PR improves the robustness of the
features_to_image_shapes
function by allowing it to handle mixed valid and invalid features without terminating. Additionally, it expands the test coverage to ensure more thorough testing of edge cases and potential failure points in the feature conversion process.Key Changes:
Enhancement of
features_to_image_shapes
:ValueError
. This allows the processing of mixed datasets, where valid features can still be converted even if some are malformed or unsupported.New and Updated Unit Tests:
test_features_conversion_no_geometry
andtest_features_conversion_unsupported_type
:features_to_image_shapes
. They now verify that invalid features are skipped, rather than expecting exceptions.test_features_conversion_mixed
:test_features_conversion_basic_point
to confirm that simple, valid features are correctly processed and converted.convert_nested_coordinate_lists
:features_to_image_shapes
function to trace feature processing, helping to identify why valid features might be skipped.Improved Error Handling:
try-except
blocks to catch and log errors during feature processing. Invalid features are logged and skipped, instead of halting the entire process.Checklist
Before you submit a pull request, please make sure you have the following:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.